package com.schoolvisitors.context;

import com.schoolvisitors.entity.User;
import lombok.Data;


public class UserContext {
    private static final ThreadLocal<User> user = new ThreadLocal<>();

    public static void setUser(User currentUser) {

        user.set(currentUser);
    }

    public static User getUser() {
        return user.get();
    }

    public static void clear() {
        user.remove();
    }
}
